const mongoose= require('mongoose');

const testsSchema=new mongoose.Schema({
    data:String,
    exercisesId:{
        type:mongoose.SchemaTypes.Array,
        ref:'exercisesModel'
    },
    time:String,
    title:String,
    typeId:{
        type:mongoose.SchemaTypes.ObjectId,
        ref:'typesModel'
    }
});

mongoose.model('testModel',testsSchema,'tests');
module.exports.modelName='testModel';
module.exports.getAlltestModel=async function(){
    return await mongoose.model('testModel').find().populate('exercisesId').populate('typeId');
}